package com.ostrich.a2104gao5.test14

import com.google.gson.Gson

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/16 15:27
 * @Description : Test14
 */
fun main(){
    val str = "{\"username\":\"yaotianxue\",\"password\":\"1234567\"}"
    //gson解析
    val gson = Gson()
    val user = gson.fromJson(str, User::class.java)
    println("解析数据 ${user.username}")
    println(user)
}